/**
 * 应用基础配置
 */
export default {
	namespaced: true,
	/* 属性值 */
	state: { // 存储数据的状态
		appName: 'UniappFast',
		summary:'是一个专为老师打造的教学分享平台，提高课堂的趣味性',
		logo: '/static/logo.png',
		theme:"bg-gradual-blue",
		publish: { //发布配置相关
			uploadImgCount: 8, //上传图片张数
			contentTextCount: 156, //内容文本文字数量
		},
		loginInfo: { //登录信息
			// 用户信息
			user: {}, //username: "",openid: null,avatar:''
			hasLogin: false,
			loginProvider: "",
			forcedLogin: true, //是否需要强制登录	
		},
		colors: ['yellow', 'olive', 'green', 'cyan', 'orange', 'blue', 'mauve', 'pink', 'grey',
			'red', 'purple', 'brown', 'gray', 'black' /*, 'white' */
		],
		//底部导航栏
		tabbars: {
			list: [{
					text: "首页",
					text2: '好学生', //辅助标题  用于比如顶部操作栏标题显示  默认值为text
					path: "/pages/index/index",
					icon: "cuIcon-homefill",
					iconType: "font", //值image图片 、font字体图标(默认值)
					name: "home"
				}, {
					text: '课程',
					text2: '全部课程',
					path: '/pages/course/list',
					redirect: true, //跳转到新页面而不是当前首页局加载组件刷新
					icon: 'cuIcon-read',
					iconType: "font", //值image图片 、font字体图标(默认值)
					name: 'course'
				},
				{
					text: "碰一碰", 
					path: "",
					icon: "cuIcon-NFC-",  
					name: "publish",
					bulge:true 
				}
				/* ,
								{
									text: "发布",
									path: "",
									icon: "cuIcon-add",
									name: "publish",
									child: [{
											text: '说笑话',
											path: '/pages/joke/joke',
											icon: '/static/img/joke.png',
											iconType: "image", //值image图片 、font字体图标(默认值)
											name: 'joke'
										},
										{
											text: '讲故事',
											path: '/pages/joke/joke',
											icon: '/static/img/story.png',
											iconType: "image",
											name: 'story'
										},
										{
											text: '写案例',
											path: '/pages/joke/joke',
											icon: '/static/img/video.png',
											iconType: "image",
											name: 'case'
										}
									]
								}*/
				,
				{
					text: "文章",
					path: "/pages/article/list",
					redirect: true,
					icon: "cuIcon-apps",
					name: "tools"
				},
				{
					text: "我的",
					path: "/pages/user/index",
					icon: "cuIcon-my",
					badge: 1,
					name: "ucenter"
				}
			]
		},
		//轮播图片
		swipers: {
			dotStyle: false,
			indicator: true,
			circular: true,
			autoplay: true,
			list: [{
				id: 0,
				type: 'image', //video
				url: '/upload/微信.jpg',
				text: ''
			}, {
				id: 1,
				type: 'image',
				url: '/upload/就业.jpg',
				text: ''
			}]
		},
		navs: {
			gridCol: 3,
			gridBorder: false,
			list: [{
				icon: 'cuIcon-wenzi',
				//iconType: "image", //值image图片 、font字体图标(默认值)
				color: 'text-yellow',
				badge: 0,
				text: '文字签到',
				//path: "/pages/goods/list?type=joke",
				action: "textClock",
				name: "textclock"
			}, {
				icon: 'cuIcon-qr_code',
				//iconType: "image",
				color: 'text-olive',
				badge: 0,
				text: '扫码签到',
				//path: "/pages/goods/list?type=story",
				action: "scanClock",
				name: "scanClock"
			}, {
				icon: 'cuIcon-voice',
				//iconType: "image",
				color: 'text-cyan',
				badge: 0,
				text: '语音签到',
				//path: "/pages/goods/list?type=case",
				action: "speechClock",
				name: "speechClock"
			}, {
				icon: 'cuIcon-wifi',
				//iconType: "image",   
				color: 'text-mauve',
				badge: 0,
				text: '蓝牙签到',
				//path: "/pages/goods/list?type=case",
				action: "beaconClock",
				name: "beaconClock"
			}, {
				icon: 'cuIcon-kaishi',
				//iconType: "image",   
				color: 'text-blue',
				badge: 0,
				text: '抢沙发',
				//path: "/pages/goods/list?type=case",
				action: "rollcall",
				name: "rollcall"
			}, {
				icon: 'cuIcon-danmu2',
				//iconType: "image",   
				color: 'text-orange',
				badge: 0,
				text: '弹幕',
				//path: "/pages/goods/list?type=case",
				action: "barragePrompt",
				name: "barrage"
			}]
		},
		notices: {
			list: [{
					text: '零度商城开业特惠，全场8折',
					url: ""
				}
			]
		}, 
		listNavs: {
			list: [{
				id: 0,
				text: '全部',
			}, {
				id: 1,
				text: 'HTML5',
			}, {
				id: 2,
				text: 'CSS3',
			}, {
				id: 3,
				text: 'JS',
			}, {
				id: 4,
				text: 'C#',
			}, {
				id: 5,
				text: 'Asp.net',
			}, {
				id: 6,
				text: 'Vue',
			}, {
				id: 7,
				text: 'Python',
			}, {
				id: 8,
				text: 'Java',
			}, {
				id: 9,
				text: 'SQL',
			}, {
				id: 10,
				text: '小程序',
			}, {
				id: 11,
				text: '面试',
			}]
		},
		tags: {
			list: [{
				id: 0,
				text: 'HTML5',
			}] 
		}
	},
	/* 
		计算属性 
		定义 doneTodos:(state, getters,rootState)=>{}
		使用 store.getters.doneTodosCount
	*/
	getters: { // 获取vuex数据（state）的统一接口

	},
	/* 
		计算方法
		定义 increment :function(state,data){}
		使用 store.commit('increment', data) or  store.commit({type:'increment',...data})
	 */
	mutations: { // 存vuex数据（state）的统一接口
		login(state, data) {
			state.loginInfo.hasLogin = true;
			state.loginInfo.user = data;
		},
		logout(state) {
			state.loginInfo.hasLogin = false;
			state.loginInfo.userInfo = {};
		},
		setOpenid(state, openid) {},
		setListNavs(state, listNavs) {
			listNavs = listNavs.map(function(item) {
				return {
					id: item.id,
					text: item.name
				};
			})
			listNavs.unshift({
				id: 0,
				text: "全部"
			})
			state.listNavs.list = listNavs
		}
	},
	/* 
			state.openid = openid
		导步计算方法 // vuex内的异步操作接口
		定义 incrementAsync  :function ({ commit, state,dispatch,rootState  },data){commit('increment',data)}
		使用 store.dispatch('incrementAsync', data) or  store.commit({type:'incrementAsync',...data})
	 */
	actions: {		
	}
}
